package org.lg.example;

public class TestFatherAndSon {
    public static void main(String[] args) {
        new Test1Servlet().service("post");
    }
}
class HttpServlet{
    public void service(String methodType){
        if(methodType.equals("get")){
            this.doGet();
        }else  if(methodType.equals("post")){
            this.doPost();
        }
    }
    public void doPost(){
        System.out.println("doPost");
    }
    public void doGet(){
        System.out.println("doGet");
    }
}
class Test1Servlet extends HttpServlet{
    public void service(String methodType){
        System.out.println("service");
    }
}
